<template>
  <div class="about">
    <h1>This is an about page</h1>
    <hr>
    <h1>{{ count }} <el-button @click="add">+</el-button> </h1>
    <ul>
      <li
        v-for="item in list"
        :key="item.id"
      >
        <h2>{{ item.title }}</h2>
      </li>
    </ul>
    <h1>{{getMsg}}</h1>
  </div>
</template>

<script>
import { mapState, mapGetters, mapMutations } from 'vuex'

export default {
  data() {
    return {
      // list: []
    }
  },
  computed: {
    ...mapState('app', ['count', 'list']),
    ...mapGetters('app', ['getMsg'])
    /*count() {
      return this.$store.state.count
    },
    list() {
      return this.$store.state.list
    }*/
  },
  methods: {
    ...mapMutations('app', ['SET_COUNT']),
    add() {
      // this.SET_COUNT()
      this.$store.commit('app/SET_COUNT')
    }
  }
}
</script>

